﻿using Microsoft.EntityFrameworkCore;
using P10_StudentManage.Models;

namespace P10_StudentManage.Data;

public class GradeContext : DbContext
{
    public DbSet<Grade> Grades { get; set; }

    protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
    {
        var dbPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "student_grades.db");
        optionsBuilder.UseSqlite($"Data Source={dbPath}"); // 指定 SQLite 数据库文件
    }
}
